package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by admin on 2017/6/7.
 * 心电阅片订单列表
 */

public class OrderRefreshApi extends BaseApi {
    OrderRefreshReq req;

    public OrderRefreshApi(String order_id, String serial_number, String order_status) {
        req = new OrderRefreshReq(order_id, serial_number, order_status);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).orderStateRefresh(requestBody);
    }

    class OrderRefreshReq {

        /**
         * order_id : 11212
         * serial_number : 131231313131313131
         * order_status : 1 ,//更新订单状态 1 为支付成功 支付失败不更新订单状态
         */

        private String order_id;
        private String serial_number;
        private String order_status;

        public OrderRefreshReq(String order_id, String serial_number, String order_status) {
            this.order_id = order_id;
            this.serial_number = serial_number;
            this.order_status = order_status;
        }
    }
}
